3.210 \(\int \cot ^6(e+f x) (a+b \tan ^2(e+f x))^2 \, dx\)

Optimal. Leaf size=68 \[ -\frac {a^2 \cot ^5(e+f x)}{5 f}+\frac {a (a-2 b) \cot ^3(e+f x)}{3 f}-\frac {(a-b)^2 \cot (e+f x)}{f}-x (a-b)^2 \]

[Out]

-(a-b)^2*x-(a-b)^2*cot(f*x+e)/f+1/3*a*(a-2*b)*cot(f*x+e)^3/f-1/5*a^2*cot(f*x+e)^5/f

________________________________________________________________________________________

Rubi [A]  time = 0.08, antiderivative size = 68, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {3670, 461, 203} \[ -\frac {a^2 \cot ^5(e+f x)}{5 f}+\frac {a (a-2 b) \cot ^3(e+f x)}{3 f}-\frac {(a-b)^2 \cot (e+f x)}{f}-x (a-b)^2 \]

Antiderivative was successfully verified.

[In]

Int[Cot[e + f*x]^6*(a + b*Tan[e + f*x]^2)^2,x]

[Out]

-((a - b)^2*x) - ((a - b)^2*Cot[e + f*x])/f + (a*(a - 2*b)*Cot[e + f*x]^3)/(3*f) - (a^2*Cot[e + f*x]^5)/(5*f)

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 461

Int[(((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_))/((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Int[ExpandIntegr
and[((e*x)^m*(a + b*x^n)^p)/(c + d*x^n), x], x] /; FreeQ[{a, b, c, d, e, m}, x] && NeQ[b*c - a*d, 0] && IGtQ[n
, 0] && IGtQ[p, 0] && (IntegerQ[m] || IGtQ[2*(m + 1), 0] ||  !RationalQ[m])

Rule 3670

Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol]
 :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist[(c*ff)/f, Subst[Int[(((d*ff*x)/c)^m*(a + b*(ff*x)^n)^p)/(c^
2 + ff^2*x^2), x], x, (c*Tan[e + f*x])/ff], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ
[n, 2] || EqQ[n, 4] || (IntegerQ[p] && RationalQ[n]))

Rubi steps

\begin {align*} \int \cot ^6(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx &=\frac {\operatorname {Subst}\left (\int \frac {\left (a+b x^2\right )^2}{x^6 \left (1+x^2\right )} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {\operatorname {Subst}\left (\int \left (\frac {a^2}{x^6}-\frac {a (a-2 b)}{x^4}+\frac {(a-b)^2}{x^2}-\frac {(a-b)^2}{1+x^2}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac {(a-b)^2 \cot (e+f x)}{f}+\frac {a (a-2 b) \cot ^3(e+f x)}{3 f}-\frac {a^2 \cot ^5(e+f x)}{5 f}-\frac {(a-b)^2 \operatorname {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=-(a-b)^2 x-\frac {(a-b)^2 \cot (e+f x)}{f}+\frac {a (a-2 b) \cot ^3(e+f x)}{3 f}-\frac {a^2 \cot ^5(e+f x)}{5 f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C]  time = 0.10, size = 104, normalized size = 1.53 \[ -\frac {a^2 \cot ^5(e+f x) \, _2F_1\left (-\frac {5}{2},1;-\frac {3}{2};-\tan ^2(e+f x)\right )}{5 f}-\frac {2 a b \cot ^3(e+f x) \, _2F_1\left (-\frac {3}{2},1;-\frac {1}{2};-\tan ^2(e+f x)\right )}{3 f}-\frac {b^2 \cot (e+f x) \, _2F_1\left (-\frac {1}{2},1;\frac {1}{2};-\tan ^2(e+f x)\right )}{f} \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[e + f*x]^6*(a + b*Tan[e + f*x]^2)^2,x]

[Out]

-1/5*(a^2*Cot[e + f*x]^5*Hypergeometric2F1[-5/2, 1, -3/2, -Tan[e + f*x]^2])/f - (2*a*b*Cot[e + f*x]^3*Hypergeo
metric2F1[-3/2, 1, -1/2, -Tan[e + f*x]^2])/(3*f) - (b^2*Cot[e + f*x]*Hypergeometric2F1[-1/2, 1, 1/2, -Tan[e +
f*x]^2])/f

________________________________________________________________________________________

fricas [A]  time = 0.41, size = 81, normalized size = 1.19 \[ -\frac {15 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} f x \tan \left (f x + e\right )^{5} + 15 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} \tan \left (f x + e\right )^{4} - 5 \, {\left (a^{2} - 2 \, a b\right )} \tan \left (f x + e\right )^{2} + 3 \, a^{2}}{15 \, f \tan \left (f x + e\right )^{5}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^6*(a+b*tan(f*x+e)^2)^2,x, algorithm="fricas")

[Out]

-1/15*(15*(a^2 - 2*a*b + b^2)*f*x*tan(f*x + e)^5 + 15*(a^2 - 2*a*b + b^2)*tan(f*x + e)^4 - 5*(a^2 - 2*a*b)*tan
(f*x + e)^2 + 3*a^2)/(f*tan(f*x + e)^5)

________________________________________________________________________________________

giac [B]  time = 7.94, size = 222, normalized size = 3.26 \[ \frac {3 \, a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} - 35 \, a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 40 \, a b \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 330 \, a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 600 \, a b \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 240 \, b^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 480 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} {\left (f x + e\right )} - \frac {330 \, a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - 600 \, a b \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} + 240 \, b^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - 35 \, a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 40 \, a b \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 3 \, a^{2}}{\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5}}}{480 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^6*(a+b*tan(f*x+e)^2)^2,x, algorithm="giac")

[Out]

1/480*(3*a^2*tan(1/2*f*x + 1/2*e)^5 - 35*a^2*tan(1/2*f*x + 1/2*e)^3 + 40*a*b*tan(1/2*f*x + 1/2*e)^3 + 330*a^2*
tan(1/2*f*x + 1/2*e) - 600*a*b*tan(1/2*f*x + 1/2*e) + 240*b^2*tan(1/2*f*x + 1/2*e) - 480*(a^2 - 2*a*b + b^2)*(
f*x + e) - (330*a^2*tan(1/2*f*x + 1/2*e)^4 - 600*a*b*tan(1/2*f*x + 1/2*e)^4 + 240*b^2*tan(1/2*f*x + 1/2*e)^4 -
 35*a^2*tan(1/2*f*x + 1/2*e)^2 + 40*a*b*tan(1/2*f*x + 1/2*e)^2 + 3*a^2)/tan(1/2*f*x + 1/2*e)^5)/f

________________________________________________________________________________________

maple [A]  time = 0.69, size = 91, normalized size = 1.34 \[ \frac {b^{2} \left (-\cot \left (f x +e \right )-f x -e \right )+2 a b \left (-\frac {\left (\cot ^{3}\left (f x +e \right )\right )}{3}+\cot \left (f x +e \right )+f x +e \right )+a^{2} \left (-\frac {\left (\cot ^{5}\left (f x +e \right )\right )}{5}+\frac {\left (\cot ^{3}\left (f x +e \right )\right )}{3}-\cot \left (f x +e \right )-f x -e \right )}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(f*x+e)^6*(a+b*tan(f*x+e)^2)^2,x)

[Out]

1/f*(b^2*(-cot(f*x+e)-f*x-e)+2*a*b*(-1/3*cot(f*x+e)^3+cot(f*x+e)+f*x+e)+a^2*(-1/5*cot(f*x+e)^5+1/3*cot(f*x+e)^
3-cot(f*x+e)-f*x-e))

________________________________________________________________________________________

maxima [A]  time = 0.80, size = 78, normalized size = 1.15 \[ -\frac {15 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} {\left (f x + e\right )} + \frac {15 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} \tan \left (f x + e\right )^{4} - 5 \, {\left (a^{2} - 2 \, a b\right )} \tan \left (f x + e\right )^{2} + 3 \, a^{2}}{\tan \left (f x + e\right )^{5}}}{15 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^6*(a+b*tan(f*x+e)^2)^2,x, algorithm="maxima")

[Out]

-1/15*(15*(a^2 - 2*a*b + b^2)*(f*x + e) + (15*(a^2 - 2*a*b + b^2)*tan(f*x + e)^4 - 5*(a^2 - 2*a*b)*tan(f*x + e
)^2 + 3*a^2)/tan(f*x + e)^5)/f

________________________________________________________________________________________

mupad [B]  time = 11.52, size = 76, normalized size = 1.12 \[ 2\,a\,b\,x-b^2\,x-\frac {{\mathrm {cot}\left (e+f\,x\right )}^5\,\left ({\mathrm {tan}\left (e+f\,x\right )}^4\,\left (a^2-2\,a\,b+b^2\right )+\frac {a^2}{5}+{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (\frac {2\,a\,b}{3}-\frac {a^2}{3}\right )\right )}{f}-a^2\,x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(e + f*x)^6*(a + b*tan(e + f*x)^2)^2,x)

[Out]

2*a*b*x - b^2*x - (cot(e + f*x)^5*(tan(e + f*x)^4*(a^2 - 2*a*b + b^2) + a^2/5 + tan(e + f*x)^2*((2*a*b)/3 - a^
2/3)))/f - a^2*x

________________________________________________________________________________________

sympy [A]  time = 8.46, size = 134, normalized size = 1.97 \[ \begin {cases} \tilde {\infty } a^{2} x & \text {for}\: \left (e = 0 \vee e = - f x\right ) \wedge \left (e = - f x \vee f = 0\right ) \\x \left (a + b \tan ^{2}{\relax (e )}\right )^{2} \cot ^{6}{\relax (e )} & \text {for}\: f = 0 \\- a^{2} x - \frac {a^{2}}{f \tan {\left (e + f x \right )}} + \frac {a^{2}}{3 f \tan ^{3}{\left (e + f x \right )}} - \frac {a^{2}}{5 f \tan ^{5}{\left (e + f x \right )}} + 2 a b x + \frac {2 a b}{f \tan {\left (e + f x \right )}} - \frac {2 a b}{3 f \tan ^{3}{\left (e + f x \right )}} - b^{2} x - \frac {b^{2}}{f \tan {\left (e + f x \right )}} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)**6*(a+b*tan(f*x+e)**2)**2,x)

[Out]

Piecewise((zoo*a**2*x, (Eq(e, 0) | Eq(e, -f*x)) & (Eq(f, 0) | Eq(e, -f*x))), (x*(a + b*tan(e)**2)**2*cot(e)**6
, Eq(f, 0)), (-a**2*x - a**2/(f*tan(e + f*x)) + a**2/(3*f*tan(e + f*x)**3) - a**2/(5*f*tan(e + f*x)**5) + 2*a*
b*x + 2*a*b/(f*tan(e + f*x)) - 2*a*b/(3*f*tan(e + f*x)**3) - b**2*x - b**2/(f*tan(e + f*x)), True))

________________________________________________________________________________________